package com.cssy.yd.logic.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.byd.acegiext.domain.User;
import com.cssy.yd.logic.dao.LogicPoItemDAO;
import com.cssy.yd.logic.entity.LogicPoItemDO;
import com.cssy.yd.logic.service.ILogicPoItemService;
import com.plat.exception.SyBaseException;
import com.plat.helper.SearchConditions;
import com.plat.helper.SearchResult;
import com.plat.util.IDCodeTypeUtil;
@Service("logicPoItemService")
public class LogicPoItemServiceImpl implements ILogicPoItemService {
	
	@Resource(name = "logicPoItemDAO")
	LogicPoItemDAO logicPoItemDAO;
	@Override
	public SearchResult findListByExample(SearchConditions scs)
			throws SyBaseException {
		// TODO Auto-generated method stub
		SearchResult rs=new SearchResult(scs);
		List<LogicPoItemDO>  list=logicPoItemDAO.find(scs);
		rs.setRecordCount(logicPoItemDAO.count(scs));
		rs.setResults(list);
		return rs;
	}

	@Override
	public Integer delete(String id, User user) throws SyBaseException {
		logicPoItemDAO.deleteLogicPoItemDOByPrimaryKey(id);
		return null;
	}

	@Override
	public Integer update(LogicPoItemDO t, User user) throws SyBaseException {
		logicPoItemDAO.updateLogicPoItemDO(t);
		return null;
	}

	@Override
	public LogicPoItemDO save(LogicPoItemDO t, User user) throws SyBaseException {
		t.setId(IDCodeTypeUtil.getId());
		logicPoItemDAO.insertLogicPoItemDO(t);
		return t;
	}

	@Override
	public LogicPoItemDO findListById(String id) throws SyBaseException {
		return logicPoItemDAO.findLogicPoItemDOByPrimaryKey(id);
	}

	@Override
	public Integer deleteBizRemoved(String id) throws SyBaseException {
		// TODO Auto-generated method stub
		return null;
	}
}
